<button class="btn btn-primary" type="button" ng-click="add()">新增</button>
<button class="btn btn-primary" type="button" ng-click="del()">删除</button>
<button class="btn btn-primary" type="button" ng-click="edit()">编辑</button>
<button class="btn btn-primary" type="button" ng-click="reload()">刷新</button>
<hr>
<table class="table table-striped">
    <thead>
    <tr>
        <th></th>
        <th>序号</th>
        <th>院系名称</th>
        <th>备注</th>
    </tr>
    </thead>
    <tbody>
    <tr ng-repeat="d in depts" on-repeat-finish="renderTable()">
        <td><input type="checkbox" name="list" value="{{$index}}"></td>
        <td>{{$index+1}}</td>
        <td>{{d.name}}</td>
        <td>{{d.description}}</td>
    </tr>
    </tbody>
</table>
<script type="text/ng-template" id="add.html">
    <div class="modal-header">
        <h4 class="modal-title">{{dept.id?"编辑":"增加"}}院系</h4>
    </div>
    <div class="modal-body">
        <div class="line line-dashed b-b line-lg pull-in"></div>
        <form class="form-horizontal">
            <div class="form-group {{!dept.name&&check?'has-error':''}}">
                <label for="title" class="col-md-2 control-label">院系名称</label>
                <div class="col-md-8">
                    <div class="form-group">
                        <input id="title" name="name" type="text" ng-model="dept.name" class="form-control rounded" required>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-2 control-label" for="desc">备注</label>
                <div class="col-md-8">
                    <div class="form-group">
                        <textarea name="description" id="desc" maxlength="255" ng-model="dept.description" class="form-control rounded" rows="5"></textarea>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <div class="modal-footer">
        <button class="btn btn-primary" ng-click="ok()">确定</button>
        <button class="btn btn-default" ng-click="cancel()">取消</button>
    </div>
</script>